package top.xiaoazi.futureletterserver.module.verifycode.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import top.xiaoazi.futureletterserver.module.verifycode.entity.VerifyCode;
import top.xiaoazi.futureletterserver.module.verifycode.mapper.VerifyCodeMapper;
import top.xiaoazi.futureletterserver.module.verifycode.vo.VerifyCodeVO;

import java.util.List;

@Service
public class VerifyCodeService {

    @Autowired
    private VerifyCodeMapper verifyCodeMapper;

    public int add(VerifyCode verifyCode) {
        return verifyCodeMapper.add(verifyCode);
    }

    public VerifyCode getById(Integer id) {
        return verifyCodeMapper.getById(id);
    }

    public int update(VerifyCode verifyCode) {
        return verifyCodeMapper.update(verifyCode);
    }

    public int del(VerifyCode verifyCode) {
        return verifyCodeMapper.del(verifyCode);
    }

    public List<VerifyCode> getList() {
        return verifyCodeMapper.getList();
    }

    public List<VerifyCodeVO> getListVO() {
        return verifyCodeMapper.getListVO();
    }

    public String getVerifyCode(Integer id) {
        VerifyCode verifyCode = verifyCodeMapper.getVerifyCode(id);
        return verifyCode.getResult();
    }
}
